package guda.mrpc.core.client;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Created by well on 17/5/26.
 */
public class ReferenceFactory {


    private Map<String, ReferenceConfig> referenceMap = new ConcurrentHashMap();

    private static final class ReferenceFactoryHolder {
        private static final ReferenceFactory instance = new ReferenceFactory();
    }

    public void addHandler(String key, ReferenceConfig value) {
        referenceMap.put(key, value);
    }

    public Map<String, ReferenceConfig> getAllHandle(){
        return referenceMap;
    }


    public static ReferenceFactory instance() {
        return ReferenceFactoryHolder.instance;
    }

}
